<?php

namespace app\api\controller\v1\untils;

use app\admin\model\DataMessage;
use app\api\controller\Api;

class Message extends Api
{

    public function get(){
        $rule = [
            'type'    => 'require',
        ];
        $message  =   [
            'type.require' => '信息类别不为空'
        ];
        $this->validate($this->post, $rule,$message);
        $msg = new DataMessage();
        $msg =$msg->where(['type'=>$this->post['type']])->select();
        $this->success('获取成功',$msg);

    }

    public function list(){
        $list = [
            [
                'id'=>0,
                'name'=>'系统公告'
            ],
            [
                'id'=>1,
                'name'=>'提醒消息'
            ],
        ];
        $this->success('获取成功',$list);

    }



}